package club.hicode.daydayup.netty.websocket.server;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.timeout.IdleStateHandler;

import java.util.concurrent.TimeUnit;

/**
 * XXXX
 *
 * @author LiuChunfu
 * @date 2018/6/18
 */
public class MySerInitlizer extends ChannelInitializer<SocketChannel> {


    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();
        pipeline.addLast(new IdleStateHandler(5, 10, 12, TimeUnit.SECONDS));
        pipeline.addLast(new MyIdleServerHandler());

    }
}
